package com.tgy.hash.type;

/**
 * @Author: tgy
 * @Date: 2020-09-24 09:29
 */
public class FloatHash {

    public static void main(String[] args) {

        Float num = 10.12f;

        /**
         * float的hash值是获取计算机内存中存放float类型值的二进制顺序转成int
         * Float.floatToIntBits()
         */
        String string = Integer.toBinaryString(Float.floatToIntBits(num));
        System.out.println(string);
        System.out.println(num.hashCode());

    }
}
